import { Camera } from "./camera.js"
import { Know } from "./know.js"
/**
 * 初始化摄像头 
 * @param { Number } width 摄像头容器宽
 * @param { Number } height 摄像头容器高
 * @param { Number } cameraWidth 摄像头宽
 * @param { Number } cameraHeight 摄像头高
 */
export async function ApiArCamera(width = window.innerWidth, height = window.innerHeight, cameraWidth = window.innerWidth, cameraHeight = window.innerHeight,) {
    try {
        let camera = new Camera(width, height, cameraWidth, cameraHeight)
        await camera.openCamera()
        return Promise.resolve(camera)
    } catch (err) {
        return Promise.reject(new Error("ArToolkitCamera:" + err.message))
    }
}
/**
  * @param { Object } param 相关参数
  */
export async function ApiArKnow(param) {
    try {
        let know = new Know(param)
        await know.Init()
        return Promise.resolve(know)
    } catch (err) {
        return Promise.reject(new Error("ArToolkitThreeNFT:" + err.message))
    }
}